<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>对一个任意精度数字取模</title>
 </head>
 <body class="docs"><div id="layout">
  <div id="layout-content"><div id="function.bcmod" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">bcmod</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7)</p><p class="refpurpose"><span class="refname">bcmod</span> &mdash; <span class="dc-title">对一个任意精度数字取模</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.bcmod-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>bcmod</strong></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$left_operand</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$modulus</code></span>
   ) : <span class="type">string</span></div>

  <p class="para rdfs-comment">
   对左操作数使用<code class="parameter">系数</code>取模
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.bcmod-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>

    
     <dt>
<code class="parameter">left_operand</code></dt>

     <dd>

      <p class="para">
       字符串类型的左操作数
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">modulus</code></dt>

     <dd>

      <p class="para">
       字符串类型系数
      </p>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.bcmod-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   返回字符串类型取模后结果，如果系数为0则返回null
  </p>
 </div>

 
 <div class="refsect1 examples" id="refsect1-function.bcmod-examples">
  <h3 class="title">范例</h3>
  <div class="example" id="example-4054">
   <p><strong>Example #1 <span class="function"><strong>bcmod()</strong></span> example</strong></p>
   <div class="example-contents">
<div class="phpcode"><pre><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">bcmod</span><span style="color: #007700">(</span><span style="color: #DD0000">'4'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'2'</span><span style="color: #007700">);&nbsp;</span><span style="color: #FF8000">//&nbsp;0<br /></span><span style="color: #007700">echo&nbsp;</span><span style="color: #0000BB">bcmod</span><span style="color: #007700">(</span><span style="color: #DD0000">'2'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'4'</span><span style="color: #007700">);&nbsp;</span><span style="color: #FF8000">//&nbsp;2<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</pre></div>
   </div>

  </div>
 </div>

 
 <div class="refsect1 seealso" id="refsect1-function.bcmod-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="bcdiv.html" class="function" rel="rdfs-seeAlso">bcdiv()</a> - 2个任意精度的数字除法计算</span></li>
   </ul>
  </p>
 </div>

</div></div></div></body></html>